<?php echo $this->doctype('XHTML1_STRICT'); ?>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<?php 
$this->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
                 ->appendHttpEquiv('Content-Language', 'en-US');             
                 
echo $this->headMeta() . "\n";
$this->headTitle('Image Slide');

echo "\n";
     
echo $this->headTitle() . "\n\n";

//$height = 500;
//$width  = 960;

$height = $this->screenHeight;
$width  = $this->screenWidth;

?>


</head>
<style>

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #000;
}

body {
    overflow: hidden;
}

object#thisYtPlayer {
    margin-top: -<?php echo (int)($height / 2); ?>px;
    top: 50%;
    position: relative;
}

</style>
<body>
<div style="text-align: center; height: 100%;">
<script type="text/javascript" src="<?php echo $this->baseUrl(); ?>/public/scripts/swfobject.js"></script>    

<div id="ytApiPlayer">
   You need Flash player 8+ and JavaScript enabled to view this video.
</div>

<script type="text/javascript">

    var params = { allowScriptAccess: "always" };
    var atts = { id: "thisYtPlayer" };
    swfobject.embedSWF("http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=ytplayer", 
                       "ytApiPlayer", <?php echo $width; ?>, <?php echo $height; ?>, "8", null, null, params, atts);
    

    function onYouTubePlayerReady(playerId) {
        ytplayer = document.getElementById("thisYtPlayer");
        ytplayer.loadVideoById('<?php echo $this->videoId; ?>', parseInt(0));
        ytplayer.playVideo();
        ytplayer.setVolume(<?php echo $this->volume; ?>);
        <?php if ($this->mute) : ?>
        ytplayer.mute();
        <?php endif; ?>
    }      
    
</script>
</div>
</body>
</html>